package cn.by.wms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import cn.by.wms.entity.*;
import cn.by.wms.service.WarehouseService;

import java.util.List;

/**
 * 库房;(206_warehouse)控制层
 * @author : heimi
 * @date : 2024-11-22
 */
@RestController
@RequestMapping("/api/warehouse")
public class WarehouseController{
    @Autowired
    private WarehouseService warehouseService;

    /**
     * 查询接口
     */
     @GetMapping
     public List<Warehouse> select(WarehouseQuery query){
        return warehouseService.select(query);
    }

    @PostMapping
    public Integer insert(@RequestBody Warehouse product){
       return warehouseService.insert(product);
    }

    @PutMapping
    public Integer update(@RequestBody Warehouse product){
        return warehouseService.update(product);
    }

    @DeleteMapping
    public Integer delete(Integer id){
        return warehouseService.delete(id);
    }
}